#ifndef CTODAY_H
#define CTODAY_H
//------------------------------------------------------------------------------------------------
//  Author: Kebal
//  Date:   6-6-13
//  Desc:   Class to handle day activities, totals and calculations. Also holds temp data for
//          today only.
//------------------------------------------------------------------------------------------------

//---------------------------
//  Includes
//---------------------------
#include <QString>
#include <QTime>
#include <QObject>

#include "Globals.h"
#include "CWorkingDay.h"
#include "todaywindow.h"


//--------------------------
//  Class
//--------------------------
class   CToday : public CWorkingDay, public QObject
{
    Q_OBJECT;

public:
    CToday( TodayWindow twin );
    CToday( QString buff );

    virtual ~CToday();

    //----------------------------------
    //  General controls/helpers
    //----------------------------------
    void        SetActivity( ACTIVITIES action );
    void        Start( ACTIVITIES action = Other );
    void        Stop( ACTIVITIES action = Other );

    //----------------------------------
    //  Specific controls
    //----------------------------------
    void        StartTraveling();
    void        StopTraveling();

    void        StartDropping();
    void        StopDropping();

    void        StartCollecting();
    void        StopCollecting();

    void        StartDelivering();
    void        StopDelivering();


    //---------------------------------
    //  Incrementers/Decrementers
    //---------------------------------
    void        AddOrdersCollected( int amount = 1 );
    void        AddRetailValue( double famount = 1.0f );
    void        AddDropped( int amount = 1 );
    void        AddCollected( int amount = 1 );
    void        AddDelivered( int amount = 1 );

    void        RemoveOrdersCollected( int amount = 1 );
    void        RemoveRetailValue( double famount = 1.0f );
    void        RemoveDropped( int amount = 1 );
    void        RemoveCollected( int amount = 1 );
    void        RemoveDelivered( int amount = 1 );

private:
    int         m_iActivity;

    QTime       m_tTravelTimeStart;         //  Time started traveling
    QTime       m_tTravelTimeStop;          //  Time stopped traveling

    QTime       m_tDropTimeStart;           //  Time started dropping
    QTime       m_tDropTimeStop;            //  Time stopped dropping

    QTime       m_tCollectTimeStart;        //  Time started collecting
    QTime       m_tCollectTimeStop;         //  Time stopped collecting

    QTime       m_tDeliverTimeStart;        //  Time started delivering
    QTime       m_tDeliverTimeStop;         //  Time stopped delivering

private slots:
    void        OnActionStart( ACTIVITIES action );
};

#endif // CTODAY_H
